home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_iperf.idb / usr / freeware / bin / jperf.z / jperf
Text File  |  2002-07-08  |  1KB  |  52 lines

  1. #!/bin/sh
  2. #
  3. # jperf startup script for unix
  4. # mark gates
  5. # $Id: jperf,v 1.1 2000/01/10 20:06:02 mgates Exp $
  6.  
  7. ########################################
  8. # function find_prg_binary
  9. # modifies $PRG to the pathname of its binary
  10. #
  11. # since `type -p foo` doesn't always work,
  12. # use `type foo | sed -e 's/.* is //g'
  13. #
  14. # testing for sym links varies between -h or -L
  15. # instead, do an `ls -l` and look for the sym link arrow
  16. #
  17. find_prg_binary( )
  18. {
  19.   PRG=`type $PRG | sed -e 's/.* is //g'`
  20.   newprg=`expr "\`/bin/ls -l "$PRG"\`" : ".*$PRG -> \(.*\)"`
  21.   while [ $newprg ]
  22.   do
  23.     expr "$newprg" : "\/" >/dev/null || newprg="`dirname $PRG`/$newprg"
  24.     PRG="$newprg"
  25.     newprg=`expr "\`/bin/ls -l "$PRG"\`" : ".*$PRG -> \(.*\)"`
  26.   done
  27. }
  28.  
  29. ########################################
  30. # add SWING_HOME to the classpath
  31. #
  32.  
  33. if [ ! -z "${SWING_HOME}" ] ; then
  34.   CLASSPATH=${CLASSPATH}:${SWING_HOME}/swing.jar
  35. fi
  36.  
  37. ########################################
  38. # add jperf's jar file
  39. # we have to know the path to the jar file, which
  40. # should be in the same directory as this script
  41. #
  42.  
  43. PRG=$0
  44. find_prg_binary
  45. JPERF_PATH=`dirname $PRG`
  46.  
  47. CLASSPATH=${CLASSPATH}:${JPERF_PATH}/jperf.jar
  48. export CLASSPATH
  49.  
  50. CMD="java Interface $*"
  51. ${CMD}
  52.